package com.hjwoo.app.ui;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.TextView;

import com.hjwoo.app.R;

public class CenterAlertBenefitDialog extends Dialog implements OnClickListener
{

    private Button remove_dialog;
    private String titleStr;
    private String contentStr;

    public CenterAlertBenefitDialog(Context context, String titleStr, String contentStr)
    {
        super(context);
        this.titleStr = titleStr;
        this.contentStr = contentStr;
    }

    public CenterAlertBenefitDialog(Context context, int theme, String titleStr, String contentStr)
    {
        super(context, theme);
        this.titleStr = titleStr;
        this.contentStr = contentStr;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialogview);
        Window win = getWindow();
        win.setGravity(Gravity.CENTER);
        WindowManager.LayoutParams lp = win.getAttributes();
        lp.width = WindowManager.LayoutParams.MATCH_PARENT;
        win.setAttributes(lp);
       /* TextView title   = (TextView) this.findViewById(R.id.alertdialog_center_title);
        TextView content = (TextView) this.findViewById(R.id.alertdialog_center_content);
        title.setText(titleStr);
        content.setText(contentStr);*/
        remove_dialog = (Button) this.findViewById(R.id.remove_dialog);
        remove_dialog.setOnClickListener(this);
    }

    @Override
    public void onClick(View v)
    {
        switch (v.getId())
        {
        case R.id.remove_dialog:
            this.dismiss();
            break;
        }
    }
}
